package com.maple.blog.controller.aop;

import com.maple.blog.config.CustomAttributesConfig;
import org.springframework.web.bind.annotation.ControllerAdvice;
import org.springframework.web.bind.annotation.ModelAttribute;

import java.beans.ConstructorProperties;

/**
 * 描述: com.maple.blog.controller.aop
 *
 * @author hz.lei
 * @date 2018年04月27日 下午11:34
 */
@ControllerAdvice
public class CustomAttributesAdvice {

    private final CustomAttributesConfig customAttributesConfig;

    @ModelAttribute("custom")
    public CustomAttributesConfig customAttributes() {
        return this.customAttributesConfig;
    }

    @ConstructorProperties({"customAttributesConfig"})
    public CustomAttributesAdvice(final CustomAttributesConfig customAttributesConfig) {
        this.customAttributesConfig = customAttributesConfig;
    }
}
